﻿using System;

class TriangleSurface
{
    static void Main()
    {
        Console.WriteLine("Calculating the surface of a triangle:");
        Console.WriteLine("By given side and altitude: " + SurfaceWithSideAndAltitude(3, 4));
        Console.WriteLine("By given three sides: " + SurfaceWithThreeSides(3, 4, 5));
        Console.WriteLine("By given two sides and an angle: " + SurfaceWithTwoSidesAndAngle(3, 4, 90));
    }

    static double SurfaceWithSideAndAltitude(double a, double h)
    {
        return (a * h) / 2;
    }

    static double SurfaceWithThreeSides(double a, double b, double c)
    {
        double p = (a + b + c) / 2;

        return Math.Sqrt(p * (p - a) * (p - b) * (p - c));
    }
    
    static double SurfaceWithTwoSidesAndAngle(double a, double b, double angle)
    {
        return (a * b * Math.Sin(Math.PI * angle / 180)) / 2;
    }
}